﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" EnableEventValidation="false"
    AutoEventWireup="true" CodeFile="SendMessage.aspx.cs" Inherits="member_Message_SendMessage"
    Title="我发出的留言" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="server">
  <script type="text/ecmascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
    </script>
    <form id="form1">
        <div id="sub_content">
            <div class="pagetitle">
                我发出的留言</div>
            <div class="tishi">
                <span>提&nbsp;示：</span>·留言的有效期为1年，系统将自动删除超出有效期的留言。请注意保存重要留言！
            </div>
            <div class="main_Supply_nav">
                <ul>
                    <li class="Check">所有留言</li>
                    <li class="search">
            <table border="0" cellpadding="0" cellspacing="0" width="440">
                <tr>
                    <td>
                        <asp:TextBox ID="txtMessage" runat="server" ToolTip="请输入留言" Width="123" Height="17"></asp:TextBox>
                        <asp:DropDownList ID="dropMessageState" runat="server">
                            <asp:ListItem Selected="True" Value="">留言状态</asp:ListItem>
                            <asp:ListItem Value="0">对方未读</asp:ListItem>
                            <asp:ListItem Value="1">对方已读</asp:ListItem>
                            <asp:ListItem Value="2">对方已回复</asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="dropMessageDate" runat="server">
                            <asp:ListItem Value="七天内的留言">七天内的留言</asp:ListItem>
                            <asp:ListItem Value="一个月内的留言">一个月内的留言</asp:ListItem>
                            <asp:ListItem Selected="True" Value="三个月内的留言">三个月内的留言</asp:ListItem>
                            <asp:ListItem Value="三个月以上留言">三个月以上留言</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnSelect" runat="server" OnClick="btnSelect_Click" Text="立即查询" CssClass="i_button" /></td>
                </tr>
            </table>
           </li>
                </ul>
            </div>
        <asp:GridView ID="grdMessage" runat="server" AutoGenerateColumns="False" CellPadding="0"
            GridLines="None" DataKeyNames="ID" CssClass="table_main">
            <Columns>
                <asp:TemplateField HeaderText="选项">
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server" Width="30" />
                    </ItemTemplate>
                    <HeaderStyle CssClass="th20 tou" />
                    <ItemStyle CssClass="nolet" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="状态">
                    <ItemTemplate>
                        <%# GetCharacter(Eval("Restore").ToString())%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="留言标题">
                    <ItemTemplate>
                        <a href='MessageDetail.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"ID") %>&Name=<%# Eval("LoginName")%>'>
                            <%# DataBinder.Eval(Container.DataItem,"Title") %>
                        </a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="发给">
                    <itemtemplate>
                            <%# GetNewTitle(DataBinder.Eval(Container.DataItem, "LoginName").ToString())%>
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="留言日期">
                    <ItemTemplate>
                        <%# GetShortDate(DataBinder.Eval(Container.DataItem, "Date").ToString())%>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <div class="paging">
            <p>
                总记录数：<asp:Label ID="txt_pageCount" runat="server"></asp:Label>
                页码：<asp:Label ID="txt_begin" runat="server"></asp:Label>/<asp:Label ID="txt_pageAll"
                    runat="server"></asp:Label>
                <asp:LinkButton ID="txt_pageFirst" runat="server" OnClick="txt_pageFirst_Click">首页</asp:LinkButton>
                <asp:LinkButton ID="txt_pageLast" runat="server" OnClick="txt_pageLast_Click">上一页</asp:LinkButton>
                <asp:LinkButton ID="txt_pageNext" runat="server" OnClick="txt_pageNext_Click">下一页</asp:LinkButton>
                <asp:LinkButton ID="txt_pageFoot" runat="server" OnClick="txt_pageFoot_Click">末页</asp:LinkButton>
                <asp:TextBox ID="txt_PageNum" runat="server" Width="30px"></asp:TextBox>
                <asp:LinkButton ID="Lk_go" runat="server" OnClick="Lk_go_Click">GO</asp:LinkButton></p>
            <input id="CheckBox2" name="CheckBox2" type="checkbox" onclick="SelectAll();" />全选
            <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" Text="批量删除" OnClick="btnDelete_Click"
                CssClass="i_button" />
        </div></div>
    </form>
</asp:Content>
